import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    //mode: 'history', // 去掉url中的#
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/sys-message-list',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/sys-message-list.vue'),
                    meta: { title: '消息管理' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/sys-user-list',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/sys-user-list.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/login-log-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/login-log-list.vue'),
                    meta: { title: '登录日志' }
                },
                {
                    path: '/sys-role-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-role-list.vue'),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/sys-dept-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-dept-list.vue'),
                    meta: { title: '部门管理' }
                },
                {
                    path: '/sys-menu-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-menu-list.vue'),
                    meta: { title: '菜单管理' }
                },
                {
                    path: '/sys-dict-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-dict-list.vue'),
                    meta: { title: '字典管理' }
                },
                {
                    path: '/sys-dict-data-list/:dictType',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-dict-data-list.vue'),
                    meta: { title: '字典数据' }
                },
                {
                    path: '/sys-notice-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-notice-list.vue'),
                    meta: { title: '通知公告' }
                },
                {
                    path: '/sys-log-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-log-list.vue'),
                    meta: { title: '系统日志' }
                },
                {
                    path: '/sys-job-log-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-job-log-list.vue'),
                    meta: { title: '定时日志' }
                },
                {
                    path: '/sys-job-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/sys-job-list.vue'),
                    meta: { title: '定时任务' }
                },
                {
                    path: '/gen-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/gen-list.vue'),
                    meta: { title: '代码生成' }
                },
                {
                    path: '/shop-info',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/shop/shop-info.vue'),
                    meta: { title: '店铺信息' }
                },
                {
                    path: '/shop-banner-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/shop/shop-banner-list.vue'),
                    meta: { title: '轮播图' }
                },
                {
                    path: '/shop-item-cat-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/shop/shop-item-cat-list.vue'),
                    meta: { title: '商品分类' }
                },
                {
                    path: '/shop-item-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/shop/shop-item-list.vue'),
                    meta: { title: '商品管理' }
                },
                {
                    path: '/deploy-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/deploy/deploy-list.vue'),
                    meta: { title: '部署管理' }
                },
                {
                    path: '/deploy-app-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/deploy/deploy-app-list.vue'),
                    meta: { title: '应用管理' }
                },
                {
                    path: '/deploy-server-list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/deploy/deploy-server-list.vue'),
                    meta: { title: '服务器' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
